# -*- coding: utf-8 -*-

import xlrd,os

data = xlrd.open_workbook('course.xlsx') # 打开xls文件
table = data.sheets()[0] # 打开第一张表
num_rows = table.nrows # 获取表的行数

for i in xrange(num_rows): # 循环逐行打印
    if i == 0: # 跳过第一行
        continue
    print table.row_values(i) # 第一列

# #遍历sheet1中所有行row
# num_rows = table.nrows
# for curr_row in range(num_rows):
#     row = table.row_values(curr_row)
#     print('row%s is %s' %(curr_row,row))

# #遍历sheet1中所有列col
# num_cols = table.ncols
# for curr_col in range(num_cols):
#     col = table.col_values(curr_col)
#     print('col%s is %s' %(curr_col,col))
#
# #遍历sheet1中所有单元格cell
# for rown in range(num_rows):
#     for coln in range(num_cols):
#         cell = table.cell_value(rown,coln)
#         print cell

#获取单元格中值的类型，类型 0 empty,1 string, 2 number, 3 date, 4 boolean, 5 error
# cell_type = table.cell_type(rown,coln)
# print cell_type